extends Node2D

var current_weapon : Weapon
var current_bullet : Bullet

func _on_weapon_shoot(bullet: Bullet):
	add_child(bullet)

func _on_WeaponPanel_select(w : Weapon):
	if current_weapon:
		current_weapon.queue_free()
	yield(get_tree(),"idle_frame")
	current_weapon = w.duplicate()
	add_child(current_weapon)
	current_weapon.connect("shoot", self, "_on_weapon_shoot")
